// https://nodejs.org/api/util.html
const util = require('util');

async function fn() {
	return 'hello';
}

const callbackFn = util.callbackify(fn);

callbackFn((err,ret) => {
	if (err) throw err;
	console.log('callback return value -> ', ret);
});


function fn1() {
	Promise.reject(null);
}

const callbackFn1 = util.callbackify(fn);

callbackFn((err, ret) => {
	// true
	console.log(err && err.hasOwnProperty('reason') && err.reason === null);
})



